package com.ruoyi.system.controlle;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.FlowChart;
import com.ruoyi.system.domain.MenuLevel;
import com.ruoyi.system.domain.PersonnelInformationUser;
import com.ruoyi.system.service.MenuLevelService;
import com.ruoyi.system.service.PersonnelInformationUserService;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;

/**
 *描述 ：人员信息
 *@author senyuan.li
 *@date 19:23 2024/3/31
 *@param 
 *@return 
 **/
@Controller
@RequestMapping("/menuLevel")
public class menuLevelController extends BaseController
{

    @Autowired
    private MenuLevelService menuLevelService;



    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(@RequestBody MenuLevel menulevel)
    {

        List<MenuLevel> list = menuLevelService.selectFileDataList(menulevel);
        return getDataTable(list);
    }


    @PostMapping("/add")
    @ResponseBody
    public Map addSave(@RequestBody MenuLevel menulevel)
    {

        int i = menuLevelService.insertMenuLevel(menulevel);
        Map map=new HashMap();
        map.put("success","成功");
        return map;

    }
    @PostMapping("/edit")
    @ResponseBody
    public Map update(@RequestBody MenuLevel menuLevelList)
    {

        int i = menuLevelService.update(menuLevelList);
        Map map=new HashMap();
        map.put("success","成功");
        return map;

    }

}